/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * | 报审相关接口模块
 * +----------------------------------------------------------------------
 */
layui.define(['jquery', 'configure', 'configureCom','bluebird'], function (exports) {
    var configure = layui.configure;
    var configureCom = layui.configureCom;
    var apply = {
        param: {
            resultId: -1,
            resultType: 0,
            data: {
                acceptType:'',//三方机构类型分号分割【1010住建、1020消防、1030人防】示例【1010;1020】
                organizationId:'',//三方机构编号示例【1010;1020】
                singleProjectId:'',//单位工程ID
                reportType:'',//受理类型(1020:待办,1030:分发,1040:三方结论完成,1050:已办,1055:退回)
                dataAttachmentDTOListJsonStr:''//附件dto
            }
        },
        applyConfirm:function () {
            //报审确认接口
            return new Promise(function (resolve, reject) {
                configureCom.putDataAjax(configure.APPLY_CONFIRM_HTTP,apply.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        applyCancle:function () {
            //取消报审
            return new Promise(function (resolve, reject) {
                configureCom.putDataAjax(configure.APPLY_CANCEL_HTTP,apply.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        refusedApplyDetail:function () {
            //获取已拒绝单位工程的报审详情接口
            return new Promise(function (resolve, reject) {
                configureCom.getAjax(configure.UNITE_DEAL_GETTHREE_HTTP,apply.param.data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        }
    };
    exports('apply', apply);
});